﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using Castle.Components.Validator;
using MiragePWF.NH.Validation;
using Wolfut.MirageEE.Kernal.Common;
using Wolfut.MirageEE.Domain.CommonUtilities;

namespace Wolfut.MirageEE.Domain.Procurement
{
    /// <summary>
    /// 采购退货信息
    /// </summary>
    /// <remarks>
    /// Author: Bruce
    /// Date: 2009-03-15
    /// </remarks>
    [ActiveRecord("PURCHASE_GOODSRETURNED_DETAILS")]
    public class POGoodsReturnOrderDetail : PersistentObjectWithGuid
    {

        #region 采购退货单ID
        private string purchaseGoodReturnID = string.Empty;
        /// <summary>
        /// 采购退货单编号
        /// </summary>
        [Property("PURCHASE_GOODSRETURNED_ID")]
        [ValidateLength(0, 40, "采购退货单编号 超长！")]
        public virtual string PurchaseGoodReturnID
        {
            get { return purchaseGoodReturnID; }
            set { purchaseGoodReturnID = value; }
        }
        #endregion

        #region 商品ID
        private string productID = string.Empty;

        /// <summary>
        /// 商品ID
        /// </summary>
        [Property("PRODUCTS_ID")]
        [ValidateLength(0, 40, "商品ID超长")]
        public virtual string ProductID
        {
            get { return productID; }
            set { productID = value; }
        }
        #endregion

        #region 科目ID
        private string subjectID = string.Empty;
        /// <summary>
        /// 科目ID
        /// </summary>
        [Property("SUBJECT_ID")]
        [ValidateLength(0, 40, "科目ID超长")]
        public virtual string SubjectID
        {
            get { return subjectID; }
            set { subjectID = value; }
        }
        #endregion        

        #region 采购类别
        private string purchaseCategory = string.Empty;

        /// <summary>
        /// 采购类别
        /// </summary>
        [Property("PURCHASE_CATEGORY")]
        [ValidateLength(0, 100, "采购类别超长！")]
        public virtual string PurchaseCategory
        {
            get
            {
                return purchaseCategory;
            }
            set
            {
                purchaseCategory = value;
            }
        }
        #endregion

        #region 采购单编号
        private string purchaseBillCode = string.Empty;

        /// <summary>
        /// 采购单编号
        /// </summary>
        [Property("PURCHASE_BILLS_CODE")]
        [ValidateLength(0, 100, "采购单编号超长！")]
        public virtual string PurchaseBillCode
        {
            get
            {
                return purchaseBillCode;
            }
            set
            {
                purchaseBillCode = value;
            }
        }
        #endregion

        #region 采购单ID
        private string purchaserBillID = string.Empty;

        /// <summary>
        /// 采购单ID
        /// </summary>
        [Property("PURCHASE_BILLS_ID")]
        [ValidateLength(0, 40, "采购单ID超长！")]
        public virtual string PurchaserBillID
        {
            get
            {
                return purchaserBillID;
            }
            set
            {
                purchaserBillID = value;
            }
        }
        #endregion

        #region 仓库ID
        private string warehouseID = string.Empty;

        /// <summary>
        /// 仓库
        /// </summary>
        [Property("WAREHOUSES_ID")]
        [ValidateLength(0, 40, "仓库ID超长！")]
        public virtual string WarehouseID
        {
            get
            {
                return warehouseID;
            }
            set
            {
                warehouseID = value;
            }
        }
        #endregion

        #region 数量
        /// <summary>
        /// 数量
        /// </summary>
        [Property("QUANTITY")]
        public virtual decimal Quantity
        {
            get { return quantity; }
            set { quantity = value; }
        }
        private decimal quantity;
        #endregion

        #region 单价
        /// <summary>
        /// 单价
        /// </summary>
        [Property("UNIT_PRICE")]
        public virtual decimal UnitPrice
        {
            get { return unitPrice; }
            set { unitPrice = value; }
        }
        private decimal unitPrice;
        #endregion

        #region 单价类别
        private string unitPriceCategory;
        /// <summary>
        /// 单价类别
        /// </summary>
        [Property("UNIT_PRICE_CATEGORY")]
        [ValidateLength(0, 40, "单价类别超长！")]
        public virtual string UnitPriceCategory
        {
            get
            {
                return unitPriceCategory;
            }
            set
            {
                unitPriceCategory = value;
            }
        }
        #endregion

        #region 折扣率
        /// <summary>
        /// 折扣率
        /// </summary>
        [Property("DISCOUNT_RATE")]
        [ValidateRange(0, 100, "折扣率必须在0到100之间！")]
        public virtual decimal DiscountRate
        {
            get { return discountRate; }
            set { discountRate = value; }
        }
        private decimal discountRate;
        #endregion       

        #region 折扣额
        /// <summary>
        /// 折扣额
        /// </summary>
        [Property("DISCOUNT_AMOUNT")]
        public virtual decimal DiscountAmount
        {
            get { return discountAmount; }
            set { discountAmount = value; }
        }
        private decimal discountAmount;
        #endregion       

        #region 税率
        /// <summary>
        /// 税率
        /// </summary>
        [Property("TAX_RATE")]
        [ValidateRange(0, 100, "税率必须在0到100之间！")]
        public virtual decimal TaxRate
        {
            get { return taxRate; }
            set { taxRate = value; }
        }
        private decimal taxRate;
        #endregion

        #region 折扣额
        /// <summary>
        /// 折扣额
        /// </summary>
        [Property("TAX_AMOUNT")]
        public virtual decimal TaxAmount
        {
            get { return taxAmount; }
            set { taxAmount = value; }
        }
        private decimal taxAmount;
        #endregion       

        #region 采购额
        /// <summary>
        /// 采购额
        /// </summary>
        [Property("PURCHASE_AMOUNT")]
        public virtual decimal PurchaseAmount
        {
            get { return purchaseAmount; }
            set { purchaseAmount = value; }
        }
        private decimal purchaseAmount;
        #endregion       

        #region 折扣额
        /// <summary>
        /// 总金额
        /// </summary>
        [Property("TOTAL_AMOUNT")]
        public virtual decimal TotalAmount
        {
            get { return totalAmount; }
            set { totalAmount = value; }
        }
        private decimal totalAmount;
        #endregion               

        #region 逻辑删除
        private Boolean isDeleted;
        [Property("IS_DELETED")]
        public virtual Boolean IsDeleted
        {
            get
            {
                return isDeleted;
            }
            set
            {
                isDeleted = value;
            }
        }
        #endregion

    }
}
